class UpperString(object):
    def __init__(self):
        self._value = ''
    def __get__(self, instance, klass):
        return self._value
    def __set__(self, instance, value):
        self._value = value.upper()

class MyClass(object):
    attribute = UpperString()

instance=MyClass()
print instance.attribute
instance.attribute = "my value"
print instance.attribute
print instance.__dict__
instance.new_att = 1
print instance.__dict__
MyClass.new_att  = UpperString()
print instance.__dict__
instance.new_att = 'other value'
print instance.new_att


